import React, { useContext } from 'react'
import './index.css'
import Item from './Item'

import { AppContext } from '../../App'

export default function List() {

  // 发布组件上下文(content)
  const { todoList } = useContext(AppContext)

  return (
    <ul className="todo-main">
      {
        todoList.map(item => <Item key={item.id} {...item} />)
      }
    </ul>
  )
}
